<template>
	<view class="content">
		<view class="store_img">
			<image @tap="upload" :src="xphoto"></image>
		</view>
		<view class="store_ul">
			<view class="store_li">
				<text class="title">公司名称</text>
				<input placeholder-class="input_zi" placeholder="请填写" />
			</view>
			<view class="store_li">
				<text class="title">公司地址</text>
				<input placeholder-class="input_zi" placeholder="请填写" />
			</view>
			<view class="store_li">
				<text class="title">营业时间</text>
				<view class="time_store">
					<picker class="picker-item" mode="time" @change="startimeChange">
						<view>{{time}}AM</view>
					</picker>
					<text>—</text>
					<picker class="picker-item" mode="time" @change="endtimeChange">
						<view>{{endtime}}PM</view>
					</picker>
				</view>

			</view>
			<view class="store_li">
				<text class="title">联系电话</text>
				<input placeholder-class="input_zi" placeholder="请填写" />
			</view>
			<view class="store_li">
				<text class="title">定位</text>
				<view class="position">
					<text @tap="chose">{{roomname}}</text>
					<text class="iconfont icon-dizhi2" @tap="chose"></text>
				</view>

			</view>
		</view>
		<button class="push">保存</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				xphoto:'../../../static/images/upload.png',
				time: '09:00',
				endtime: '09:00',
				roomname :'请选择'
			};
		},
		methods:{
			upload(){
				let that = this;
				uni.chooseImage({
					count: 1, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: function (res) {
						console.log(JSON.stringify(res.tempFilePaths));
						that.xphoto = res.tempFilePaths
					}
				});
			},
			//选择时间
			startimeChange(evt) {
				this.time = evt.detail.value;
			},
			endtimeChange(evt) {
				this.endtime = evt.detail.value;
			},
			chose(res){
				
				uni.chooseLocation({
					success:res=> {
						console.log('位置名称：' + res.name);
						console.log('详细地址：' + res.address);
						this.roomname = res.address
					},
					
				});
				
			}
		}
	}
</script>

<style>
.store_img{
	padding: 0 20upx;
	height: 320upx;
}
.store_img image{
	height: 100%;
	width: 100%;
}
.store_ul{
	padding: 0 40upx;
}
.store_li{
	border-bottom: 1px solid #eee;
}
.store_li .title{
	display: block;
	line-height: 80upx;
	color: #41434b;
	font-size: 34upx;
	font-weight: 600;
}
.store_li input{
	color: #a4a8b4;
	font-size: 28upx;
	height: 80upx;
	line-height: 80upx;
}
.store_li .input_zi{
	color: #a4a8b4;
	font-size: 28upx;
}
.time_store{
	display: flex;
	align-items: center;
	color: #a4a8b4;
	font-size: 28upx;
}
.time_store picker view{
	color: #a4a8b4;
	font-size: 28upx;
	line-height: 80upx;
}
.time_store text{
	color: #a4a8b4;
	font-size: 28upx;	
	padding: 0 10upx;
	font-weight: normal;
}
.push {
  background: #5b71fa;
  border: none;
  width: 250rpx;
  height: 70rpx;
  line-height: 70rpx;
  color: #fff;
  border-radius: 50rpx;
  font-size: 34rpx;
  margin: 100rpx auto;
}
.position{
	justify-content: space-between;
	display: flex;
	line-height: 100upx;
}
.position text:last-child{
	color: #546AF9;
	font-size: 56upx;
}
.position text{
	color: #a4a8b4;
	font-size: 28upx;
}
</style>
